import request from '@/utils/request'
import URL_KEY from '@/api/urlKeys'

const #(beanName)Service = "/#(moduleName)/#(beanName)/";

export const #(beanName)ListUrl = "/#(moduleName)/#(beanName)/list";
export const #(beanName)FormUrl = "/#(moduleName)/#(beanName)/form";

export const #(beanName)_queryPageApi = #(beanName)Service + URL_KEY.page;
export const #(beanName)_queryListApi = #(beanName)Service + URL_KEY.list;
export const #(beanName)_queryByIdApi = #(beanName)Service + URL_KEY.id;
export const #(beanName)_insertApi = #(beanName)Service + URL_KEY.add;
export const #(beanName)_updateApi = #(beanName)Service + URL_KEY.update;
export const #(beanName)_deleteApi = #(beanName)Service + URL_KEY.delete;
export const #(beanName)_deletesApi = #(beanName)Service + URL_KEY.deletes;

/**
*@description #(comment)新增
*@param #(beanName)
*@author light_dust_creator
*@date #(nowDate)
*/
export function #(beanName)Insert(#(beanName)) {
	return request.post(#(beanName)_insertApi, #(beanName));
}

/**
*@description #(comment)删除
*@param #(beanName)
*@author light_dust_creator
*@date #(nowDate)
*/
export function #(beanName)Delete(#(beanName)) {
	return request.post(#(beanName)_deleteApi, #(beanName));
}

/**
*@description #(comment)删除_批量
*@param #(beanName)
*@author light_dust_creator
*@date #(nowDate)
*/
export function #(beanName)Deletes(#(beanName)s) {
	return request.post(#(beanName)_deletesApi, #(beanName)s);
}

/**
*@description #(comment)修改
*@param #(beanName)
*@author light_dust_creator
*@date #(nowDate)
*/
export function #(beanName)Update(#(beanName)) {
	return request.post(#(beanName)_updateApi, #(beanName));
}

/**
*@description #(comment)查询分页
*@param queryParam
*@author light_dust_creator
*@date #(nowDate)
*/
export function #(beanName)Page(queryParam) {
	return request.get(#(beanName)_queryPageApi, { params: queryParam });
}

/**
*@description #(comment)查询所有
*@param queryParam
*@author light_dust_creator
*@date #(nowDate)
*/
export function #(beanName)List(queryParam) {
	return request.get(#(beanName)_queryListApi, { params: queryParam });
}

/**
*@description #(comment)查询详情
*@param #(beanName)Id #(comment)id
*@author light_dust_creator
*@date #(nowDate)
*/
export function get#(upperBeanName)(#(beanName)Id) {
	return request.get(#(beanName)_queryByIdApi + #(beanName)Id);
}